package Car;

public class Factory {
    public static car getFruitInstanceByType(String fruitTypeName){
        car instanceOfFruitReturned = null;
        if ( fruitTypeName.equalsIgnoreCase("大众") ){
            instanceOfFruitReturned = new dazhongEntity();
        }else if (fruitTypeName.equals("宝马")){
            instanceOfFruitReturned = new bengchiEntity();
        } else if (fruitTypeName.equals("奔驰")) {
            instanceOfFruitReturned = new baomaEntity();
        }
        return  instanceOfFruitReturned;
    }
}
